package com.mars.module.admin.entity;

public class NewsScore implements Comparable<NewsScore> {
    public String newsTitle;
    public int score;

    public Long newsId;

    public NewsScore(String newsTitle, int score, Long newsId) {
        this.newsTitle = newsTitle;
        this.score = score;
        this.newsId = newsId;
    }

    @Override
    public String toString() {
        return "News{" +
                "newsTitle='" + newsTitle + '\'' +
                ", score=" + score +
                '}';
    }

    @Override
    public int compareTo(NewsScore o) {
        return score > o.score ? -1 : 1;
    }

}

